const fs = require('fs')
let configPath = './config.development.js';
let config = require(fs.existsSync(configPath) ? configPath : './config.js');
let nm = require('./source')
//实体
nm.$.merge(config,require('./entity'))
//初始化
nm.init(config)
require('./source/init.js')(nm.models(), {
	id:'juzao',
	name:'聚造',
	menus:[//初始化时超管后台菜单
		{name:'首页',url:'/pages/index/index'},
		{name:'系统设置',children:[
			{name:'菜单管理',url:'/pages/menu/list/list'},
			{name:'权限管理',url:'/pages/group/list/list'},
			{name:'单位管理',url:'/pages/unit/list/list'},
			{name:'用户管理',url:'/pages/user/list/list'}
		]},
		{name:'商品管理',children:[
			{name:'商品管理',url:'/pages/product/list/list'},
			{name:'单品管理',url:'/pages/model/list/list?modelName=sku&nickName=单品'},
			{name:'分类管理',url:'/pages/category/list/list'},
			{name:'品牌管理',url:'/pages/brand/list'},
		]},
		{name:'商场管理',children:[
			{name:'首页管理',url:'/pages/mall/index/index'},
			{name:'新闻管理',url:'/pages/news/list'},
			{name:'会员管理',url:'/pages/member/list/list'},
			{name:'订单管理',url:'/pages/model/list/list?modelName=order&nickName=订单'}
			
		]}
	]
})